<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for pages/data/dleft/index.vue</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../../../prettify.css" />
    <link rel="stylesheet" href="../../../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(../../../sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="../../../index.html">All files</a> / <a href="index.html">pages/data/dleft</a> index.vue
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>0/31</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>0/8</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>0/6</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>0/31</span>
      </div>
    </div>
  </div>
  <div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&lt;template&gt;
	&lt;div class="left-content"&gt;
		&lt;div class="left-box"&gt;
			&lt;databox :title="''" :dheight="720"&gt;
				&lt;personal :personalData="personalData" :username="username"&gt;&lt;/personal&gt;
				&lt;databox :title="'仓库Stars详情'" :dheight="280" :icon="'account'" :boxb="false"&gt;
			     	&lt;ve-pie :data="starData" :extend="extend" :height="'250px'"&gt;&lt;/ve-pie&gt;
			     	 &lt;nodata :nodata="'一个Stars'" v-if="noStarData"&gt;&lt;/nodata&gt;
				 &lt;/databox&gt;
				 &lt;databox :title="'仓库语言分类'" :dheight="280" :icon="'account'" :boxb="false"&gt;
			     	 &lt;ve-ring :data="languageData" :extend="extend" :height="'230px'"&gt;&lt;/ve-ring&gt;
			     	 &lt;nodata :nodata="'一种语言'" v-if="nolanguageData"&gt;&lt;/nodata&gt;
				 &lt;/databox&gt;
		&lt;/databox&gt;
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/template&gt;
&nbsp;
&lt;script&gt;
<span class="cstat-no" title="statement not covered" >import personal from './personal'</span>
<span class="cstat-no" title="statement not covered" >import { LINE_DATA1} from '../test/data'</span>
export default {
  components:{
  	personal
  },
  props: {
    personalData:Object,
    username:String
  },
<span class="fstat-no" title="function not covered" >  data () {</span>
<span class="cstat-no" title="statement not covered" >  	 this.extend = {</span>
        legend:{
        	 textStyle: {color: '#fff'},
        },
        grid: {
            textStyle: {
                color: "#fff"
            }
          },
          series:{
          	radius:['0','40%'],
          	center: ['50%', '50%']
          }
    }
<span class="cstat-no" title="statement not covered" >    return {</span>
      personalD:{},
      starData:{
		  columns: ['reposName', 'getStars'],
		  rows: [
		  ]
		},
      noStarData:false,
      languageData:{
		  columns: ['lang', 'number'],
		  rows: [
		  ]
		},
      nolanguageData:false
    }
  },
<span class="fstat-no" title="function not covered" >  created(){</span>
  },
  methods:{
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >  	getData(username){</span></span>
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >    	this.$axios.get('/api/users/'+ username + '/repos').then((response)=&gt;{</span></span>
<span class="cstat-no" title="statement not covered" >      	    let data = JSON.parse(JSON.stringify(response.data))</span>
<span class="cstat-no" title="statement not covered" >      	    if(data.length&lt;1){</span>
<span class="cstat-no" title="statement not covered" >	    		this.noStarData = true</span>
	    	}else{
<span class="cstat-no" title="statement not covered" >	    		let rowdata = []</span>
<span class="cstat-no" title="statement not covered" >	    		let languages = {}</span>
<span class="cstat-no" title="statement not covered" >		        for(var i=0;i&lt;data.length;i++){	</span>
		        	// 仓库和仓库star
<span class="cstat-no" title="statement not covered" >	        		let reposName = data[i].name</span>
<span class="cstat-no" title="statement not covered" >	        		let getStars = data[i].stargazers_count</span>
<span class="cstat-no" title="statement not covered" >	        		let obj = {</span>
                            reposName:reposName,
                            getStars:getStars
                       }
<span class="cstat-no" title="statement not covered" >                    rowdata.push(obj)</span>
                    
                    //梳理语言，计算语言类型和各个语言的数量
<span class="cstat-no" title="statement not covered" >                    let langData =data[i].language</span>
<span class="cstat-no" title="statement not covered" >                    if (langData) {</span>
<span class="cstat-no" title="statement not covered" >			            if (langData in languages) {</span>
<span class="cstat-no" title="statement not covered" >			                languages[langData]++;</span>
			            }else {
<span class="cstat-no" title="statement not covered" >			                languages[langData] = 1;</span>
			            }
			        }
		        }
		        //把值附到starData.rows
<span class="cstat-no" title="statement not covered" >		        this.starData.rows = rowdata</span>
		        //console.log(this.starData.rows)
                 
                 //重新组装语言封成对象
<span class="cstat-no" title="statement not covered" >		        let objL = JSON.parse(JSON.stringify(languages))</span>
<span class="cstat-no" title="statement not covered" >		        let dataL =[]</span>
<span class="cstat-no" title="statement not covered" >		        for(var key in objL){</span>
<span class="cstat-no" title="statement not covered" >		         	dataL.push({"lang":key,"number":objL[key]}) </span>
		         }
<span class="cstat-no" title="statement not covered" >		       this.languageData.rows = dataL</span>
		        //console.log(objL)  
		        //console.log(this.languageData.rows)
	    	}  
<span class="cstat-no" title="statement not covered" >		    return</span>
		    
		    
<span class="fstat-no" title="function not covered" >	    	}).catch(err =&gt; {</span>
<span class="cstat-no" title="statement not covered" >			   console.log(err.message);</span>
			})
  	   }
    },
  watch:{
<span class="fstat-no" title="function not covered" >  	 username(username){</span>
<span class="cstat-no" title="statement not covered" >  	 	if(username){</span>
<span class="cstat-no" title="statement not covered" >  	 		 this.getData(username)</span>
  	 	}
  	 }
  }
}
&lt;/script&gt;
&nbsp;
&lt;style lang="scss"&gt;
	.left-content{
		width: 100%;
		height: 100%;
	.left-box{
		width: 100%;
		height: 720px;
		
		padding-bottom:40px ;
		.content-wapper{
			padding-top: 40px;
			height: 220px;
		}
	}
}
&lt;/style&gt;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Thu Feb 14 2019 11:04:45 GMT+0800 (CST)
</div>
</div>
<script src="../../../prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="../../../sorter.js"></script>
</body>
</html>
